import request from '@/utils/request'

export function getProducts(query) {
  return request({
    url: '/supply/product/getList',
    method: 'post',
    data: query
  })
}

export function getProduct(data) {
  return request({
    url: '/supply/product/getDetail',
    method: 'post',
    data: data
  })
}
export function changeStatusByProductID(id) {
  return request({
    url: '/supply/product/change-status',
    method: 'post',
    data: id
  })
}

export function saveProduct(formdata) {
  return request({
    url: '/supply/product/save',
    method: 'post',
    data: formdata
  })
}

export function getProductListByDistribution(data) {
  return request({
    url: '/supply/product/getDistributionList',
    method: 'post',
    data: data
  })
}

export function removeProductByID(id) {
  return request({
    url: '/supply/product/remove',
    method: 'post',
    data: id
  })
}

export function fetchProductAvabile() {
  return request({
    url: '/supply/product/getAvailable',
    method: 'post'
  })
}
